package com.hutao.chargingpile.pitfall.service.impl;

import com.hutao.chargingpile.pitfall.mapper.CpHitchMapper;
import com.hutao.chargingpile.pitfall.pojo.entity.*;
import com.hutao.chargingpile.pitfall.service.CpHitchService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 故障表 服务实现类
 * </p>
 *
 * @author HuTao
 * @since 2023-03-22
 */
@Service
public class CpHitchServiceImpl extends ServiceImpl<CpHitchMapper, CpHitch> implements CpHitchService {
    @Resource
    private CpHitchMapper cpHitchMapper;

    @Override
    public List<CpHidden> findAll(Map<String,Object> map) {
        return cpHitchMapper.findAll(map);
    }

    @Override
    public int count(Map<String,Object> map) {
        return cpHitchMapper.count(map);
    }

    @Override
    public List<String> findChargingStations() {
        return cpHitchMapper.findChargingStations();
    }

    @Override
    public List<CpHandleCode> findCpHandleCode() {
        return cpHitchMapper.findCpHandleCode();
    }

    @Override
    public List<String> findHandlePerson() {
        return cpHitchMapper.findHandlePerson();
    }

    @Override
    public CpHitch findHitchById(String id) {
        return cpHitchMapper.findHitchById(id);
    }

    @Override
    public int updateHitchById(Map<String,Object> map) {
        return cpHitchMapper.updateHitchById(map);
    }

    @Override
    public int returnPerson(Map<String, Object> map) {
        return cpHitchMapper.returnPerson(map);
    }

    @Override
    public boolean isHandle(String id) {
        return cpHitchMapper.isHandle(id);
    }

    @Override
    public boolean dealSave(CpHitchDeal hitchDeal) {
        if(cpHitchMapper.dealSaveOk(hitchDeal.getHitchId()) && cpHitchMapper.dealSave(hitchDeal)){
            return true;
        }else{
            return false;
        }
    }

    @Override
    public boolean isDeal(Long id) {
        return cpHitchMapper.isDeal(id);
    }

    @Override
    public CpHitchDeal findDealByHitchId(Long id) {
        return cpHitchMapper.findDealByHitchId(id);
    }

    @Override
    public boolean dealSaveNew(CpHitchDeal hitchDeal) {
        return cpHitchMapper.dealSaveNew(hitchDeal);
    }

    @Override
    public CpHitch fetchDataById(Long id) {
        return cpHitchMapper.fetchDataById(id);
    }

    @Override
    public CpHitchDeal fetchDataDealById(Long id) {
        return cpHitchMapper.fetchDataDealById(id);
    }

    @Override
    public List<CpHitch> cpHitchExport() {
        return cpHitchMapper.cpHitchExport();
    }
}
